#include <iostream>

using namespace std;

/* 无参构造想调用有参构造必须使用初始化列表*/
class Person
{
public:
    Person() : Person(0)
    {
        cout<<"父类无参构造"<<endl;
    }
    Person(int age) : m_age(age)
    {
        cout<<"父类有参构造"<<endl;
    }
private:
    int m_age;
};

class Student : public Person
{
public:
    Student() : Student(0, 0)
    {
        cout<<"子类无参构造"<<endl;
    }
    //Student(int no, int age) : m_age(age),m_no(no){}这个方法不对
    Student(int no, int age) : Person(age), m_no(no)
    {
        //m_age = age;拿不到
        cout<<"子类有参构造"<<endl;
    }
public:
    int m_no;
};

int main()
{

    return 0;
}